78 WDT_A_hold(WDT_A_BASE);
81 GPIO_setAsPeripheralModuleFunctionInputPin(
86 UCS_turnOnLFXT1 (UCS_XT1_DRIVE_3,
93 PMM_setVCore (PMM_CORE_LEVEL_1);
96 UCS_initFLLSettle(12000,
103 GPIO_setAsPeripheralModuleFunctionOutputPin(
105 GPIO_PIN0 + GPIO_PIN1 + GPIO_PIN2
108 PMAP_initPortsParam initPortsParam = {0};
109 initPortsParam.portMapping = (
const uint8_t *)
port_mapping;
110 initPortsParam.PxMAPy = (uint8_t *)&P3MAP0;
111 initPortsParam.numberOfPorts = 1;
112 initPortsParam.portMapReconfigure = PMAP_DISABLE_RECONFIGURATION;
113 PMAP_initPorts(PMAP_CTRL_BASE, &initPortsParam);
121 GPIO_setAsPeripheralModuleFunctionInputPin(
126 GPIO_setAsPeripheralModuleFunctionOutputPin(
142 Timer_A_initCompareModeParam initCompParam = {0};
143 initCompParam.compareRegister = TIMER_A_CAPTURECOMPARE_REGISTER_0;
144 initCompParam.compareInterruptEnable = TIMER_A_CAPTURECOMPARE_INTERRUPT_DISABLE;
145 initCompParam.compareOutputMode = TIMER_A_OUTPUTMODE_TOGGLE;
146 initCompParam.compareValue = 32;
147 Timer_A_initCompareMode(TIMER_A0_BASE, &initCompParam);
149 Timer_A_initUpModeParam initUpParam = {0};
150 initUpParam.clockSource = TIMER_A_CLOCKSOURCE_ACLK;
151 initUpParam.clockSourceDivider = TIMER_A_CLOCKSOURCE_DIVIDER_1;
152 initUpParam.timerPeriod = 32;
153 initUpParam.timerInterruptEnable_TAIE = TIMER_A_TAIE_INTERRUPT_DISABLE;
154 initUpParam.captureCompareInterruptEnable_CCR0_CCIE =
155 TIMER_A_CAPTURECOMPARE_INTERRUPT_DISABLE;
156 initUpParam.timerClear = TIMER_A_DO_CLEAR;
157 initUpParam.startTimer =
false;
158 Timer_A_initUpMode(TIMER_A0_BASE, &initUpParam);
160 Timer_A_startCounter(TIMER_A0_BASE,
164 Timer_D_initContinuousModeParam initContParam = {0};
165 initContParam.clockSource = TIMER_D_CLOCKSOURCE_SMCLK;
166 initContParam.clockSourceDivider = TIMER_D_CLOCKSOURCE_DIVIDER_1;
167 initContParam.clockingMode = TIMER_D_CLOCKINGMODE_EXTERNAL_CLOCK;
168 initContParam.timerInterruptEnable_TDIE = TIMER_D_TDIE_INTERRUPT_DISABLE;
169 initContParam.timerClear = TIMER_D_DO_CLEAR;
170 Timer_D_initContinuousMode(TIMER_D0_BASE, &initContParam);
172 Timer_D_startCounter(TIMER_D0_BASE,
173 TIMER_D_CONTINUOUS_MODE
176 Timer_D_clearCaptureCompareInterrupt(TIMER_D0_BASE,
177 TIMER_D_CAPTURECOMPARE_REGISTER_0);
179 Timer_D_initCaptureModeParam initCapParam = {0};
180 initCapParam.captureRegister = TIMER_D_CAPTURECOMPARE_REGISTER_0;
181 initCapParam.captureMode = TIMER_D_CAPTUREMODE_RISING_EDGE;
182 initCapParam.captureInputSelect = TIMER_D_CAPTURE_INPUTSELECT_CCIxA;
183 initCapParam.synchronizeCaptureSource = TIMER_D_CAPTURE_SYNCHRONOUS;
184 initCapParam.captureInterruptEnable = TIMER_D_CAPTURECOMPARE_INTERRUPT_ENABLE;
185 initCapParam.captureOutputMode = TIMER_D_OUTPUTMODE_OUTBITVALUE;
186 initCapParam.channelCaptureMode = TIMER_D_DUAL_CAPTURE_MODE;
187 Timer_D_initCaptureMode(TIMER_D0_BASE, &initCapParam);
191 __bis_SR_register(LPM0_bits + GIE);
194 if (TIMER_D_CAPTURE_OVERFLOW == Timer_D_getCaptureCompareInterruptStatus
196 TIMER_D_CAPTURECOMPARE_REGISTER_1,
197 TIMER_D_CAPTURE_OVERFLOW
208 #if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__)
209 #pragma vector=TIMER0_D0_VECTOR
211 #elif defined(__GNUC__)
212 __attribute__((interrupt(TIMER0_D0_VECTOR)))
216 REdge1 = Timer_D_getCaptureCompareLatchCount(TIMER_D0_BASE,
217 TIMER_D_CAPTURECOMPARE_REGISTER_0);
219 REdge2 = Timer_D_getCaptureCompareCount(TIMER_D0_BASE,
220 TIMER_D_CAPTURECOMPARE_REGISTER_0);
__bic_SR_register_on_exit(LPM3_bits|GIE)
GPIO_setOutputLowOnPin(GPIO_PORT_LED1|GPIO_PORT_LED2, GPIO_PIN_LED1|GPIO_PIN_LED2)
const uint8_t port_mapping[]